//
//  SAStatisticsProfitCell.m
//  saasRetail
//
//  Created by mac on 2022/7/28.
//

#import "SAStatisticsProfitCell.h"
#import "SAInventoryListModel2.h"

@interface SAStatisticsProfitCell ()

@property (nonatomic, strong) UILabel *checkOrderNoLab;
@property (nonatomic, strong) UILabel *dateLab;
@property (nonatomic, strong) UILabel *beforeStockLab;
@property (nonatomic, strong) UILabel *afterStockLab;
@property (nonatomic, strong) UILabel *diffStockLab;

@end

@implementation SAStatisticsProfitCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initUI];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

-(void)setModel:(SAInventoryListModel2 *)model {
    _model = model;
    self.checkOrderNoLab.text = [NSString stringWithFormat:@"盘点单：%@",model.checkOrderNo];
    self.dateLab.text = model.checkOrderTime;
    self.beforeStockLab.text = [NSString stringWithFormat:@"盘前：%@",model.beforeStock];
    self.afterStockLab.text = [NSString stringWithFormat:@"盘后：%@",model.afterStock];
    self.diffStockLab.text =[NSString stringWithFormat:@"盘亏：%@",model.diffStock];
    
}

-(void)initUI {
    
    UILabel *checkOrderNoLab = [[UILabel alloc] initWithFrame:SARectMake(25, 10, 140, 20)];
    checkOrderNoLab.textColor = kBlackColor;
    checkOrderNoLab.font = kFont(15);
    checkOrderNoLab.textAlignment = NSTextAlignmentLeft;
    [self.contentView addSubview:checkOrderNoLab];
    self.checkOrderNoLab = checkOrderNoLab;
    
    UILabel *dateLab = [[UILabel alloc] initWithFrame:SARectMake(kBaseScreenWidth - 165, 10, 140, 20)];
    dateLab.textColor = kLightgGrayColor;
    dateLab.font = kFont(15);
    dateLab.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:dateLab];
    self.dateLab = dateLab;
    
    UILabel *beforeStockLab = [[UILabel alloc] initWithFrame:SARectMake(25, 40, 100, 20)];
    beforeStockLab.textColor = kBlackColor;
    beforeStockLab.font = kFont(15);
    beforeStockLab.textAlignment = NSTextAlignmentLeft;
    [self.contentView addSubview:beforeStockLab];
    self.beforeStockLab = beforeStockLab;
    
    UILabel *afterStockLab = [[UILabel alloc] initWithFrame:SARectMake(130, 40, 115, 20)];
    afterStockLab.textColor = kBlackColor;
    afterStockLab.font = kFont(15);
    afterStockLab.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:afterStockLab];
    self.afterStockLab = afterStockLab;
    
    UILabel *diffStockLab = [[UILabel alloc] initWithFrame:SARectMake(250, 40, 100, 20)];
    diffStockLab.textColor = kBlackColor;
    diffStockLab.font = kFont(15);
    diffStockLab.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:diffStockLab];
    self.diffStockLab = diffStockLab;
}

@end
